package com.qf.device.util;

import java.math.BigInteger;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

public class MD5Util {
    public static String MD5Encode(String pwd){
        String str = "";
        try {
            MessageDigest digest = MessageDigest.getInstance("MD5");
            digest.update(pwd.getBytes());
            byte[] bytes =digest.digest();
            str = new BigInteger(1,bytes).toString(16);
        } catch (NoSuchAlgorithmException e) {
            e.printStackTrace();
        }
        return str;
    }
}
